<% layout('/layouts/default.html', {title: '生产工单管理', libs: ['dataGrid']}){ %>
<div class="main-content">
	<div class="box box-main">
		<div class="box-header">
			<div class="box-title">
				<i class="fa icon-notebook"></i> ${text('生产工单管理')}
			</div>
			<div class="box-tools pull-right">
				<a href="#" class="btn btn-default" id="btnSearch" title="${text('查询')}"><i class="fa fa-filter"></i> ${text('查询')}</a>
				<% if(hasPermi('st:stProductBill:edit')){ %>
					<a href="${ctx}/st/stProductBill/form" class="btn btn-default btnTool" title="${text('新增生产工单')}"><i class="fa fa-plus"></i> ${text('新增')}</a>
				<% } %>
				<a href="#" class="btn btn-default" id="btnSetting" title="${text('设置')}"><i class="fa fa-navicon"></i></a>
			</div>
		</div>
		<div class="box-body">
			<#form:form id="searchForm" model="${stProductBill}" action="${ctx}/st/stProductBill/listMaterialRetrospect" method="post" class="form-inline hide"
					data-page-no="${parameter.pageNo}" data-page-size="${parameter.pageSize}" data-order-by="${parameter.orderBy}">
				<div class="form-group">
					<label class="control-label">${text('物料条形码')}：</label>
					<div class="control-inline">
						<#form:input path="barCode" maxlength="20" class="form-control width-120"/>
					</div>
				</div>
			<% /* %>
				<div class="form-group">
					<label class="control-label">${text('单据日期')}：</label>
					<div class="control-inline">
						<#form:input path="billDate" readonly="true" maxlength="20" class="form-control laydate width-datetime"
							dataFormat="datetime" data-type="datetime" data-format="yyyy-MM-dd HH:mm"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('已生产数量')}：</label>
					<div class="control-inline">
						<#form:input path="hasProductNumber" maxlength="8" class="form-control width-120"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('是否研发')}：</label>
					<div class="control-inline width-120">
						<#form:select path="research" dictType="st_is_research" blankOption="true" class="form-control"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('工单状态')}：</label>
					<div class="control-inline width-120">
						<#form:select path="billStatus" dictType="st_product_bill_status" blankOption="true" class="form-control"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('计划完成日期')}：</label>
					<div class="control-inline">
						<#form:input path="plainCompleteDate" readonly="true" maxlength="20" class="form-control laydate width-datetime"
							dataFormat="datetime" data-type="datetime" data-format="yyyy-MM-dd HH:mm"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('制作要求')}：</label>
					<div class="control-inline">
						<#form:input path="makeRequest" maxlength="20" class="form-control width-120"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('产品名称')}：</label>
					<div class="control-inline">
						<#form:input path="productName" maxlength="36" class="form-control width-120"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('本次配方')}：</label>
					<div class="control-inline">
						<#form:input path="thisFormula" maxlength="36" class="form-control width-120"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('工单类别')}：</label>
					<div class="control-inline width-120">
						<#form:select path="billType" dictType="st_product_bill_type" blankOption="true" class="form-control"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('工单数量')}：</label>
					<div class="control-inline">
						<#form:input path="billNumber" maxlength="8" class="form-control width-120"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('每批重量')}：</label>
					<div class="control-inline">
						<#form:input path="perWeight" maxlength="8" class="form-control width-120"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('生产批次')}：</label>
					<div class="control-inline">
						<#form:input path="productBatch" maxlength="4" class="form-control width-120"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('尾料上限')}：</label>
					<div class="control-inline">
						<#form:input path="tailingMaterialUpperLimit" maxlength="8" class="form-control width-120"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('尾料下限')}：</label>
					<div class="control-inline">
						<#form:input path="tailingMaterialLowerLimit" maxlength="8" class="form-control width-120"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('预混载体')}：</label>
					<div class="control-inline">
						<#form:input path="prepareMixCarrier" maxlength="36" class="form-control width-120"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('预混桶重量')}：</label>
					<div class="control-inline">
						<#form:input path="prepareMixWeight" maxlength="8" class="form-control width-120"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('回机料名称')}：</label>
					<div class="control-inline">
						<#form:input path="backMaterialName" maxlength="36" class="form-control width-120"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('回机料重量')}：</label>
					<div class="control-inline">
						<#form:input path="backMaterialWeight" maxlength="8" class="form-control width-120"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('审批状态')}：</label>
					<div class="control-inline width-120">
						<#form:select path="approveState" dictType="st_approve_state" blankOption="true" class="form-control"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('审批人编码')}：</label>
					<div class="control-inline">
						<#form:input path="approveManCode" maxlength="20" class="form-control width-120"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('审批人')}：</label>
					<div class="control-inline">
						<#form:input path="approveManName" maxlength="5" class="form-control width-120"/>
					</div>
				</div>
			<% */ %>
				<div class="form-group">
					<button type="submit" class="btn btn-primary btn-sm">${text('查询')}</button>
					<button type="reset" class="btn btn-default btn-sm">${text('重置')}</button>
				</div>
			</#form:form>
			<table id="dataGrid"></table>
			<div id="dataGridPage"></div>
		</div>
	</div>
</div>
<% } %>
<script>
// 初始化DataGrid对象
$('#dataGrid').dataGrid({
	searchForm: $("#searchForm"),
	columnModel: [
		{header:'${text("物料编码")}', name:'materialRecord.materialCode', index:'a.bill_date', width:150, align:"center"},
		{header:'${text("物料名称")}', name:'materialRecord.materialName', index:'a.has_product_number', width:150, align:"center"},
		{header:'${text("称重点")}', name:'weighPlaceName', index:'a.plain_complete_date', width:150, align:"center"},
		{header:'${text("生产厂家")}', name:'supplierFullName', index:'a.make_request', width:150, align:"left"},
		{header:'${text("生产日期")}', name:'productDate', index:'a.make_request', width:150, align:"left"},
		{header:'${text("保质期")}', name:'savedType', index:'a.make_request', width:150, align:"left"},
		{header:'${text("产品编号")}', name:'productRecord.productCode', index:'a.make_request', width:150, align:"left"},
		{header:'${text("产品名称")}', name:'productRecord.productName', index:'a.product_name', width:150, align:"left"},
		{header:'${text("配方编码")}', name:'formulaCode', index:'a.this_formula', width:150, align:"left"},
		{header:'${text("批次号")}', name:'batchNumber', index:'a.bill_number', width:150, align:"center"},
		{header:'${text("生产时间")}', name:'parentId.updateDate', index:'a.per_weight', width:150, align:"center"},
		{header:'${text("操作")}', name:'actions', width:120, sortable:false, title:false, formatter: function(val, obj, row, act){
			var actions = [];
			// <% if(hasPermi('st:stProductBill:edit')){ %>
			// 	actions.push('<a href="${ctx}/st/stProductBill/form?id='+row.id+'" class="btnList" title="${text("编辑生产工单")}"><i class="fa fa-pencil"></i></a>&nbsp;');
			// 	actions.push('<a href="${ctx}/st/stProductBill/delete?id='+row.id+'" class="btnList" title="${text("删除生产工单")}" data-confirm="${text("确认要删除该生产工单吗？")}"><i class="fa fa-trash-o"></i></a>&nbsp;');
			// <% } %>
			return actions.join('');
		}}
	],
	// 加载成功后执行事件
	ajaxSuccess: function(data){
		
	}
});
</script>